﻿#ifndef __SS_AUTOMIC_THREAD_H__
#define __SS_AUTOMIC_THREAD_H__
#include <cstdio>
#include "thread/ssThread.h"
#include "thread/ssAtomic.h"
#include "thread/ssAtomicLock.h"

using namespace StarSeeker;

class ssAtomicThread : public ssThreadBase
{
public:
	ssAtomicThread()
	{
	}
private:
	virtual void ThreadMemberFunc()
	{
		ssThreadBase::Sleep(10);
		++s_v1;
		++s_v2;
		ssThreadBase::Sleep(5);
		s_lock.Lock();
			++s_v3;
		s_lock.Unlock();
	}

public:
	static volatile int s_v1;
	static ssAtomicl	s_v2;
	static volatile int s_v3;
	static ssAtomicLock  s_lock;
};
volatile int ssAtomicThread::s_v1 = 0;
ssAtomicl ssAtomicThread::s_v2;
volatile int ssAtomicThread::s_v3 = 0;
ssAtomicLock ssAtomicThread::s_lock;

#endif
